package top.ztf.erp.dao;

import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;
import top.ztf.erp.domain.Permission;
import top.ztf.erp.domain.Role;
import top.ztf.erp.domain.User;

import java.util.List;
import java.util.Map;


public interface UserDao {

    List<User> getUserListByPage();

    User getUserById(String id);

    int addUser(User user);

    int updateUser(User user);

    List<User> searchList(@Param("searchName") String searchName, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("lock") String lock);

    List<Role> getAssignHasRole(String id);

    List<Role> getAssignDesRole(@Param("arrays") List<Role> list);

    void deleteAssignByUser(String userId);

    void updateAssign(@Param("userId") String userId, @Param("arrays") String[] parameterValues);

    void deleteUser(@Param("arrays") String[] parameterValues);

    User login(@Param("account") String account, @Param("password") String password);

    List<Permission> getPermissionByUser(String id);

    List<Map<String, String>> getPermissionByMenu(User user);
}
